package com.easyidea.its.domain.model.system;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.easyidea.its.domain.model.BaseEntity;

@Entity
@Table(name = "PassPort")
public class PassPort extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String passPortName; // 卡口名称
	private Department department;// 对应的部门
	private String latitudeCoor;// 经度坐标
	private String longitudeCoor;// 纬度坐标
	private String startpoint;
	private String endpoint;

	@Column(name = "startLocale", nullable = false)
	public String getStartpoint() {
		return startpoint;
	}

	public void setStartpoint(String startpoint) {
		this.startpoint = startpoint;
	}

	@Column(name = "endLocale", nullable = false)
	public String getEndpoint() {
		return endpoint;
	}

	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}

	private List<User> userList;

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "passPortList")
	public List<User> getUserList() {
		return userList;
	}

	public void setUserList(List<User> userList) {
		this.userList = userList;
	}

	@Column(name = "passPortName",length=64, nullable = false, unique = true)
	public String getPassPortName() {
		return passPortName;
	}

	public void setPassPortName(String passPortName) {
		this.passPortName = passPortName;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "department_id")
	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "latitudeCoor")
	public String getLatitudeCoor() {
		return latitudeCoor;
	}

	public void setLatitudeCoor(String latitudeCoor) {
		this.latitudeCoor = latitudeCoor;
	}

	@Column(name = "longitudeCoor")
	public String getLongitudeCoor() {
		return longitudeCoor;
	}

	public void setLongitudeCoor(String longitudeCoor) {
		this.longitudeCoor = longitudeCoor;
	}

}
